home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1999 Macromedia, Inc. All rights reserved.
-
- //*************** GLOBALS VARS *****************
-
- //******************* API **********************
-
- //***************** LOCAL FUNCTIONS ******************
-
- function initialize() {
- MM.event.handled = pasteObject();
- window.close();
- }
-
-
- function pasteObject() {
- var attainDOM, docDOM, newSel, fullSrc, retVal = false;
-
- fullSrc = dw.getClipboardText();
-
- if (fullSrc.search(/<interaction/gi) == -1 &&
- fullSrc.search(/<\/interaction>/gi) == -1) {
- return retVal;
- }
-
- setNewline(); //init NEWLINE global
-
- retVal = true;
-
- if (!regCheck()) {
- return retVal;
- }
-
- if (!siteExists()) {
- return retVal;
- }
-
- // check that the document is saved
- if (!documentSaved()) {
- return retVal;
- }
-
- if (isTemplate() || isDependent()) {
- if (!hasCBTemplateFix())
- dreamweaver.popupCommand("CourseBuilder Template Fix.htm")
- if (!hasCBTemplateFix()) {
- window.close();
- return retVal;
- }
- }
-
- // Copy support files if necessary
- if (needToCopySupportFiles()) {
- copySupportFiles(true, true, true);
- if (needToCopySupportFiles()) {
- return retVal;
- } }
-
- setBusyCursor();
-
- // create the dom objects
- docDOM = dw.getDocumentDOM();
- attainDOM = new AttainDOM();
-
- if (fullSrc) {
- newSel = attainDOM.insertSrc(fullSrc);
- if (newSel) {
- docDOM.setSelection(newSel[1], newSel[1]);
- } }
-
- clearBusyCursor();
-
- garbageCollect(true);
-
- return retVal;
- }
-
-